<!DOCTYPE html>
<html dir="ltr" lang="cn">
<head>
    <meta charset="UTF-8" /> 
    <title>退货单批量打印</title>
    <link href="__PUBLIC__/bootstrap/css/bootstrap.css" rel="stylesheet" media="all" />
    <script type="text/javascript" src="__PUBLIC__/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <link href="__PUBLIC__/bootstrap/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
	<script src="__PUBLIC__/js/layer/layer-min.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->
    <style media="print" type="text/css">.noprint{display:none}</style>
<script type="text/javascript">
	var jl_buy_list = "众创织梦配货清单";
</script> 
</head>
<body>
	<div class="print-main">
<div class="print-warp a4">
<div id="printContent_mod" style="display:none;"> 
		<style>
			.row{margin-left:0px;}
			*{ word-wrap: break-word; outline: none;}
			
			html, body, div, ul, ol, li, dl, dt, dd, h1, h2, h3, h4, h5, h6, pre, form, p, blockquote, fieldset, input, img {
			    padding: 0;
			    margin: 0;
			}
			body{
				font: 12px/20px "微软雅黑","Microsoft Yahei","sans-serif", "Arial", "Verdana";
			    color: #707070;
			    background-color: #F9F9F9;
			}
			table {
			    border-collapse: collapse;
			    border-spacing: 0;
			}
			
			.tl { text-align: left !important; }
			.tc { text-align: center !important; }
			.tr { text-align: right !important; }
			.clearfix:after,.clearfix:before{ content: ".";display: block;height: 0;clear: both;visibility: hidden;}
			.clear{ clear:both;}
			.fl{ float:left !important;}
			.fr{ float:right !important;}
			.fn{ float:none !important;}
			.pointer{ cursor:pointer;}
			.lie{ width:100%; float:left;}
			.hide{ display:none;}
			.show{ display:block;}
			
			/*长度高度
			******************************/
			.w10 { width: 10px; }
			.w20 { width: 20px; }
			.w30 { width: 30px; }
			.w40 { width: 40px !important; }
			.w50 { width: 50px !important; }
			.w60 { width: 60px !important; }
			.w65 { width: 65px !important; }
			.w70 { width: 70px !important; }
			.w80 { width: 80px !important; }
			.w90 { width: 90px; }
			.w100 { width: 100px !important; }
			.w110 { width: 110px !important; }
			.w120 { width: 120px !important; }
			.w130 { width: 130px !important; }
			.w140 { width: 140px !important; }
			.w150 { width: 150px !important; }
			.w160 { width: 160px; }
			.w180 { width: 180px; }
			.w190 { width: 190px !important; }
			.w200 { width: 200px !important; }
			.w210 { width: 210px !important; }
			.w230 { width: 230px; }
			.w240 { width: 240px; }
			.w250 { width: 250px !important; }
			.w260 { width: 260px !important; }
			.w270 { width: 270px; }
			.w290 { width: 289px !important; }
			.w300 { width: 300px !important; }
			.w319{ width:319px !important}
			.w350 { width: 350px; }
			.w340 { width: 340px; }
			.w400 { width: 400px!important; }
			.w450 { width: 450px!important; }
			.w500 { width: 500px; }
			.w600 { width: 600px !important; }
			.w700 { width: 700px; }
			.w780 { width: 780px; }
			.w800 { width: 800px; }
			
			.h10 { height: 10px; }
			.h20 { height: 20px; }
			.h30 { height: 30px; }
			.h40 { height: 40px !important; }
			.h50 { height: 50px !important; }
			.h60 { height: 60px !important; }
			.h65 { height: 65px !important; }
			.h70 { height: 70px !important; }
			.h80 { height: 80px !important; }
			.h90 { height: 90px; }
			.h100 { height: 100px !important; }
			.h110 { height: 110px !important; }
			.h120 { height: 120px !important; }
			.h130 { height: 130px !important; }
			.h150 { height: 150px !important; }
			.h160 { height: 160px; }
			.h180 { height: 180px; }
			.h190 { height: 190px !important; }
			.h200 { height: 200px !important; }
			.h210 { height: 210px !important; }
			.h230 { height: 230px; }
			.h240 { height: 240px; }
			.h250 { height: 250px !important; }
			.h270 { height: 270px; }
			.h300 { height: 300px !important; }
			.h350 { height: 350px; }
			.h340 { height: 340px; }
			.h400 { height: 400px!important; }
			.h450 { height: 450px!important; }
			.h500 { height: 500px; }
			.h600 { height: 600px !important; }
			.h700 { height: 700px; }
			.h780 { height: 780px; }
			.h800 { height: 800px; }
			
			/*后台打印订单页面 start*/
			.print-main{ position:relative;}
			.print-main .print-warp{ position:relative; width:830px; min-height:500px; margin:20px auto; box-shadow: 2px 2px 2px rgba(204,204,204,0.5); padding: 5mm 50mm 5mm 5mm; font-size:12px; background:#FAFAFA; border:1px solid #CCC;overflow: hidden;}
			
			.print-content{ background:#FFF; float:left; padding:0; width:210mm; color:#000000; position:relative; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box;}
			.print-content .print-panel{ min-height: 320px;overflow: hidden;border-bottom: 1px dashed #ddd;width:auto;display: block; position:relative; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box;}
			
			.print-warp .print-content{ border: dashed 1px #ccc;}
			
			.top{ width:100%;}
			.top:after{content:""; width:100%; height:0; display:block; overflow:hidden; float:none; clear:both;}
			.top .logo{ float:left; width:160px; height:60px; margin-right:60px;}
			.top .title{ line-height:60px; height:60px; text-align: center; width:250px; display: block; margin: auto; float:left;}
			.top .title h3{ font-size:24px;}
			.top .seal{ position:absolute; width:60px; height:60px; right:5px; top:20px;}
			
			
			.buyer-info{ margin:15px 0; display: block;}
			.buyer-info:after{content:""; width:100%; height:0; display:block; overflow:hidden; float:none; clear:both;}
			.buyer-info .row{ width:100%; overflow:hidden;}
			.buyer-info .row .lie{ float:left; line-height:22px;}
			.buyer-info .row .lie_colspan{ width:100%;}
			
			.buyer-goods-info{ position:relative; margin-bottom:15px;}
			
			.buyer-goods-info .table{ border: dashed 1px #ccc;border-bottom: 1px dashed #ddd;width:auto;display: block; position:relative; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box;background: #FFF none repeat scroll 0% 0%; font-size: 12px; border: 1px solid #333; overflow:visible; width:90%;padding-right: 13px;}
			.buyer-goods-info .table th,.print-panel .buyer-goods-info .table td{ border:1px solid #333; padding:5px; text-align:center; color:#333;}
			.buyer-goods-info .table td.p-name{ text-align:left;}
			.buyer-goods-info .table tfoot td{ padding:5px 10px;}
			
			.address-info{ overflow:hidden;}
			.address-info p{ margin-bottom:5px; text-align:right; overflow:hidden;}
			.address-info .print_textarea{ resize:none; width:100%; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; border-radius: 2px; padding: 6px;transition: none 0s ease 0s;font-size: 12px;box-shadow: none;display: inline-block;vertical-align: middle; border:solid 1px #dedede; color:#777; float:right; margin-top:10px;}
			.address-info .print_textarea:hover,.print-panel .address-info .print_textarea:active{ background-color: #fff; border: 1px solid;border-color: #1B9AF7;-moz-box-shadow: 0 0 0 2px rgba(82, 168, 236, 0.15);-webkit-box-shadow: 0 0 0 0 2px rgba(82, 168, 236, 0.15);box-shadow: 0 0 0 2px rgba(82, 168, 236, 0.15);outline: 0 none;}
			
			.print-handle{ position:absolute; right:30px; top:20px; width:140px;}
			.print-handle .print-btn{ background:#FFF; border:solid 1px #ccc; line-height:32px; padding: 5px 10px;border-radius:5px; box-shadow: 2px 2px 0 rgba(153,153,153,0.2);cursor: pointer;width: 93px; margin-bottom:20px;}
			.print-handle .print-btn a{ width: 100%;height: 100%;display: block;font-size: 20px;color: #555;font-weight: 600;letter-spacing: 0px;}
			.print-handle .print-btn .iconfont{ font-size:32px; vertical-align:middle; margin-right:15px;}
			.print-handle .print-btn:hover{ background:#555; box-shadow: none; border: 1px solid #555;}
			.print-handle .print-btn:hover a{ color:#fff;}
			
			.print-handle .print-spec{ width:140px;}
			.print-handle .print-spec:after{content:""; width:100%; height:0; display:block; overflow:hidden; float:none; clear:both;}
			.print-handle .print-spec label{ display:block; margin-bottom:5px;}
			.print-handle .print-spec p{ display:block; float:left; color:#999; margin-top:10px;}
			.print-handle .print-spec .sc-btn{ margin-top:5px;}
			.print-handle .tip{ margin-top:20px; float:left; width:140px;}
			.print-handle .tip .title{ text-align:center}
			.print-handle .tip .title h1{ font-size:72px; line-height:72px; font-weight:500; color:#333;}
			.print-handle .tip .title em{ font-family: Arial;font-size: 11px;line-height: 20px;background: #333;color: #FFF;padding: 0 5px;height: 20px;border-radius: 10px;-webkit-text-size-adjust: none;font-style: normal;font-weight: 100;}
			.print-handle .tip .desc{ line-height: 24px;text-align: left;}
			
			.print-remark{ float:left; text-align:left; color:#333;}
			
			/*打印规格*/
			.print-warp.a4 .print-panel{padding:5mm 8mm 3mm 8mm; margin-bottom:40px;}
			
			.print-warp.a4 .print-content .print-panel .top .seal,
			.print-warp.mm190mm93 .print-content .print-panel .top .seal,
			.print-warp.mm190mm140 .print-content .print-panel .top .seal,
			.print-warp.mm190mm280 .print-content .print-panel .top .seal,
			.print-warp.mm241mm93 .print-content .print-panel .top .seal,
			.print-warp.mm241mm140 .print-content .print-panel .top .seal,
			.print-warp.mm241mm280 .print-content .print-panel .top .seal,
			.print-warp.mm210mm145 .print-content .print-panel .top .seal{ width:120px; height:120px; right:30px; top:12px;}
			
			.print-warp.mm241mm93{ width: 241mm;}
			.print-warp.mm241mm93 .print-content{ width:241mm;}
			
			.print-warp.mm241mm140{ width: 241mm;}
			.print-warp.mm241mm140 .print-content{ width:241mm;}
			
			.print-warp.mm241mm280{ width: 241mm;}
			.print-warp.mm241mm280 .print-content{ width:241mm;}
			
			.print-warp.mm241mm93 .print-content .print-panel,
			.print-warp.mm241mm140 .print-content .print-panel,
			.print-warp.mm241mm280 .print-content .print-panel{ padding:5mm 8mm 3mm 8mm;}
			
			.print-warp.mm241mm93 .print-panel .top .logo,
			.print-warp.mm241mm140 .print-panel .top .logo,
			.print-warp.mm241mm280 .print-panel .top .logo{ margin-right:160px;}
			
			.print-warp.mm210mm145{ width: 210mm;}
			.print-warp.mm210mm145 .print-content{ width:210mm; height:145mm; padding:2mm}
			
			
			.print-warp.mm190mm93{ width: 190mm;}
			.print-warp.mm190mm93 .print-content{ width:190mm;}
			
			.print-warp.mm190mm140{ width: 190mm;}
			.print-warp.mm190mm140 .print-content{ width:190mm;}
			
			.print-warp.mm190mm280{ width: 190mm;}
			.print-warp.mm190mm280 .print-content{ width:190mm;}
			
			.print-warp.mm190mm93 .print-content .print-panel,
			.print-warp.mm190mm140 .print-content .print-panel,
			.print-warp.mm190mm280 .print-content .print-panel{ padding:3mm 5mm 3mm 5mm;}
			
			.print-warp.mm120mm93{ width: 120mm;}
			.print-warp.mm120mm93 .print-content{ width:120mm;}
			
			.print-warp.mm120mm140{ width: 120mm;}
			.print-warp.mm120mm140 .print-content{ width:120mm;}
			
			.print-warp.mm120mm280{ width: 120mm;}
			.print-warp.mm120mm280 .print-content{ width:120mm;}
			
			.print-warp.mm120mm93 .print-panel .top .logo,
			.print-warp.mm120mm140 .print-panel .top .logo,
			.print-warp.mm120mm280 .print-panel .top .logo{ margin-right:0; width:200px;}
			
			.print-warp.mm120mm93 .print-panel .top .title,
			.print-warp.mm120mm140 .print-panel .top .title,
			.print-warp.mm120mm280 .print-panel .top .title{ width:253px;}
			
			.print-warp.mm100{ width: 100mm;}
			.print-warp.mm100 .print-content{ width:100mm;}
			.print-warp.mm100 .print-panel .top .title{ width:160px;}
			.print-warp.mm100 .print-panel .address-info p{ text-align:left;}
			
			.print-warp.mm80{ width: 80mm;}
			.print-warp.mm80 .print-content{ width:80mm;}
			
			.print-warp.mm70{ width: 70mm;}
			.print-warp.mm70 .print-content{ width:70mm;}
			
			.print-warp.mm60{ width: 60mm;}
			.print-warp.mm60 .print-content{ width:60mm;}
			
			.print-warp.mm50{ width: 50mm; font-size:10px;}
			.print-warp.mm50 .print-content{ width:50mm;}
			 
			.print-warp.mm80 .print-panel .top .title,
			.print-warp.mm70 .print-panel .top .title,
			.print-warp.mm60 .print-panel .top .title,
			.print-warp.mm50 .print-panel .top .title{ width:100%; text-align:center; height:40px; line-height:40px;}
			
			.print-warp.mm80 .print-panel .top .title h3,
			.print-warp.mm70 .print-panel .top .title h3,
			.print-warp.mm60 .print-panel .top .title h3,
			.print-warp.mm50 .print-panel .top .title h3{ font-size:20px; color:#666;}
			
			.print-warp.mm80 .print-panel .buyer-info .row .lie,
			.print-warp.mm70 .print-panel .buyer-info .row .lie,
			.print-warp.mm60 .print-panel .buyer-info .row .lie,
			.print-warp.mm50 .print-panel .buyer-info .row .lie{ width:100%;}
			
			.print-warp.mm80 .image img,
			.print-warp.mm70 .image img,
			.print-warp.mm60 .image img,
			.print-warp.mm50 .image img{ width:100%;}
			/*后台打印订单页面 end*/
			
			/*快递鸟打印快递单*/
			.print-main .kdniao-warp{ width:375px;}
			.kdniao-warp .kdniao-content{}
			.print_paper td,.print_paper th{ color:#000;}
			.pointer{ cursor: pointer;}
		</style>
	<div class="print-content" style="width:210mm">
		<div class="print-panel mb0" style="padding:10mm 8mm 3mm 8mm; width:210mm">
			<link rel="stylesheet" type="text/css" href="https://yc.zczmer.com/Public/js/pages_print.css?v=42453"/>
	<caption>
	<div class="buyer-goods-info" id="table">
		<table class="table" style="border:none;;width:98%;">
			<thead>
				<tr>
					<th  colspan="8" style="border:none;vertical-align:middle;"><h2>{$shop_info.store_name}退货单（线路：biaoshi_xian）fast_text</h2></th>
				</tr>
				<tr>
					<th colspan="1" style="border:none;text-align: left;font-size:13px;">订单号：order_sn</th>
					<th colspan="1" style="border:none;text-align: left;font-size:13px;">原始订单号：order_sn2</th>
					<th colspan="3" style="border:none;text-align: left;font-size:13px;">客户：company</th>
					<th colspan="4" style="border:none;text-align: left;font-size:13px;">客户电话：mobile</th>
				</tr>
				<tr>
					<th colspan="2" style="border:none;text-align: left;font-size:13px;">供应商：store_name</th>
					<th colspan="4" style="border:none;text-align: left;font-size:13px;">收货地址：company_address</th>
					<th colspan="2" style="border:none;text-align:right;"><font tdata="PageNO" format="ChineseNum" color="blue">##</font>页 / <font tdata="PageCount" format="ChineseNum" color="blue">##</font>页 </th>
				</tr>
				<tr>
					<th width="6%">序号</th>
					<th width="25%">商品名称</th>
					<th width="30%">商品规格</th>
					<th width="9%">数量</th>
					<th width="10%">单价</th>
					<th width="10%">总额</th>
					<th width="5%">平台优惠</th>
					<th width="10%">小计</th>
				</tr> 
			</thead>
			<tbody>
				<tr>
				<td colspan="7" style="display:none;height:0px;">g_list</td>
				</tr>
			</tbody> 
			<tfoot>
				<tr>
					<td colspan="6" class="tr">
						<span class="red"><b>订单总金额： ¥zongjia</b></span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
					</td>
					<td colspan="1" class="tr">
						<span class="red"><b>¥coupon_price</b></span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
					</td>
					<td colspan="1" class="tr">
						<span class="red"><b> ¥total_amount</b></span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
					</td>
				</tr>
				<tr>
					<td colspan="2" class="tr" style="border:none;">
					<div class="lie w300" style="text-align: left;">供应商电话：store_phone</div>
					</td>
					<td colspan="1" class="tr" style="border:none;">
					<div class="lie_colspan" style="text-align: left;">退货时间：tuihuo_time</div>
					</td>
					<td colspan="3" class="tr" style="border:none;">
					<div class="lie_colspan" style="text-align: left;">司机：siji</div>
					</td>
				</tr>
				<tr>
					<td colspan="7" class="tr" style="border:none;">
					<div class="address-info" id="div3" style="text-align: left;">
					    <b>备注：user_note</b>
					</div>
						<div style="text-align: left;width: 80%;float:left;">
							1.如有供应商少货或退错货或退货有差价请在48小时内凭此单处理，过期自负，数量请当面点清，出门后恕不负责.<br>
							2.售后中心不再每天发退货通知，请各位供应商每天自行到售后中心领取退货。
						</div>
						<div style="width: 20%;float:right;"><img src="tuihuo_qr" style="width:130px;height: 120px;border: 2px solid #000;"/></div>
					</td>
				</tr>
			</tfoot>
		</table>
	</div>
</div>
</div>
</div>
	
	<div id="printContent">
		
	<div style="width: 400px;text-align:left;margin:auto;margin-top:10px;display: inline-block;">
		<a href="javascript:void(0);" ectype="btnPreview"  class="btn btn-info" data-original-title="预览"><i class="fa fa-eye"> 预览订单</i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="javascript:void(0);" ectype="btnPrint" class="btn btn-primary" data-original-title="一键打印"><i class="fa fa-print"></i>一键打印</a><br/>
	</div>
	<div class="print-content" style="width:210mm">
	<?php
	foreach($orders as $key=>$v){
	?>
		<div class="print-panel mb0" style="padding:5mm 5mm 3mm 5mm; width:210mm;">
	<caption>
	<div class="buyer-goods-info" id="table">
		<table class="table" style="border: none;width:100%;">
			<thead>
				<tr>
					<th  colspan="7" style="border:none; vertical-align:middle;"><h2>{$shop_info.store_name}退货单（线路：{$v.biaoshi_xian}）{$v.fast_text}</h2></th>
				</tr>
				<tr>
					<th colspan="1" style="border:none;text-align: left;font-size:13px;">订单号：{$v.order_sn}</th>
					<th colspan="1" style="border:none;text-align: left;font-size:13px;">原始订单号：{$v.order_sn2}</th>
					<th colspan="3" style="border:none;text-align: left;font-size:13px;">客户：{$v.company}</th>
					<th colspan="3" style="border:none;text-align: left;font-size:13px;">客户电话：{$v.mobile}</th>
				</tr>
				<tr>
					<th colspan="2" style="border:none;text-align: left;font-size:13px;">供应商：{$v.store_name}</th>
					<th colspan="4" style="border:none;text-align: left;font-size:13px;">收货地址：{$v.company_address}</th>
					<th colspan="2" style="border:none;text-align:right;"><font tdata="PageNO" format="ChineseNum" color="blue">##</font>页 / <font tdata="PageCount" format="ChineseNum" color="blue">##</font>页 </th>
				</tr>
				<tr>
					<th width="6%">序号</th>
					<th width="20%">商品名称</th>
					<th width="30%">商品规格</th>
					<th width="9%">数量</th>
					<th width="10%">单价</th>
					<th width="5%">总额</th>
					<th width="5%">优惠</th>
					<th width="10%">小计</th>
				</tr> 
			</thead>
			<tbody>
			<foreach name="v.g_list" item="vs" key="k">
			    <tr>
					<td>{$k+1}</td>
					<td class="p-name">{$vs.goods_name}</td>
					<td>{$vs.spec_key_name}</td>
					<td>{$vs.goods_num}</td>
					<td>{$vs.member_goods_price}</td>
					<td>{$vs.yuanjia}</td>
					<td>{$vs.coupon_price}</td>
					<td>￥{:sanwei(($vs['goods_num']*$vs['member_goods_price'])-$vs['coupon_price'])}</td>
				</tr>
			</foreach>
				</tbody> 
			<tfoot>
				<tr>
					<td colspan="6" class="tr">
						<span class="red"><b>应退总金额： ¥{$v.return_sum2}</b></span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
					</td>
					<td colspan="1" class="tr">
						<span class="red"><b> ¥{$v.zongcoupon_price}</b></span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
					</td>
					<td colspan="1" class="tr">
						<span class="red"><b> ¥{$v.return_sum}</b></span>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
					</td>
				</tr>
				<tr>
							<td colspan="2" class="tr" style="border:none;">
							<div class="lie w300" style="text-align: left;">供应商电话：{$v.store_phone}</div>
							</td>
							<td colspan="2" class="tr" style="border:none;">
							<div class="lie_colspan" style="text-align: left;">退货时间：{$v.tuihuo_time|date='Y-m-d H:i',###}</div>
							</td>
							<td colspan="2" class="tr" style="border:none;">
							<div class="lie_colspan" style="text-align: left;">司机：{$v.siji}</div>
							</td>
				</tr>
				<tr>
					<td colspan="8" class="tr" style="border:none;">

					<div class="address-info" id="div3" style="width: 80%;float: left;">
					    <textarea class="print_textarea mt20" rel='{$v.order_id}' placeholder="请输入备注信息" rows="3">{$v.remark}</textarea>
					    <p class="print-remark" title="点击重新编辑"></p>
					</div>
					<div style="width: 20%;float:right;"><img src="{$v.tuihuo_qr}" style="width:130px;height: 120px;border: 2px solid #000;"/></div>
					</td>
				</tr>
			</tfoot>
		</table>
	</div>
</div>
			<?php
			}
			?>
</div>
</div>

	</div>
    </div>
	<input type="hidden" name="order_id" value="{$order.order_id}">
    <input type="hidden" name="order_type" value="order">
    <script type="text/javascript" src="/Public/js/kd_LodopFuncss.js?v=13y5358"></script>
<script type="text/javascript">
		
var user_note=[];

	$(document).on("click","*[ectype='btnPreview']",function(){ //预览
		$("#printContent .print_textarea").each(function(){
			var beizhu=$(this).val();
			user_note.push(beizhu);
		});
		var printer = '{$print_t}';
		var width = '210mm';
		var height ='140mm';
		var print_data={$print_data};
		
		if (printer == '' || printer == null) {
			alert('没设置好打印机。');
			return false;
		}
		var html = $("#printContent_mod").html();
		var title = jl_buy_list;
		//var strStyle = "<link rel='stylesheet' type='text/css' href='https://yc.zczmer.com/Public/js/pages_print.css?v=13y3345'>";+strStyle
		$("#content").html(html);
		
    LODOP = getLodop();
   LODOP.PRINT_INIT(title); // 初始化
    if(printer)
    {
        // 指定打印机
       LODOP.SET_PRINTER_INDEX(printer);
    }

   LODOP.SET_PRINT_PAGESIZE(1,width,height,'CreateCustomPage');
	for(j=0;j<print_data.length;j++){

		var goods=huodong='';
		var g_list=print_data[j].g_list;console.log(g_list);
		
		for (i=0;i<g_list.length;i++){
				goods+='<tr><td>'+(i+1)+'</td><td class="p-name">'+g_list[i].goods_name+' </td><td>'+g_list[i].spec_key_name+'</td><td>'+g_list[i].goods_num+'</td><td>'+g_list[i].member_goods_price+'</td><td>'+g_list[i].yuanjia+'</td><td>'+g_list[i].coupon_price+'</td><td>￥'+g_list[i].xiaoji+'</td></tr>';
			}
			
		var fhtml = html.replace(/（）/g,"("+1+")");
			fhtml = fhtml.replace('biaoshi_xian',print_data[j].biaoshi_xian);
			fhtml = fhtml.replace('ID',print_data[j].id);
			fhtml = fhtml.replace('biaoshi',print_data[j].biaoshi);
			fhtml = fhtml.replace('tuihuo_qr',print_data[j].tuihuo_qr);
			fhtml = fhtml.replace('order_sn',print_data[j].order_sn);
			fhtml = fhtml.replace('order_sn2',print_data[j].order_sn2);
			fhtml = fhtml.replace('company',print_data[j].company);
			fhtml = fhtml.replace('fast_text',print_data[j].fast_text);
			fhtml = fhtml.replace('mobile',print_data[j].mobile);
			fhtml = fhtml.replace('company_address',print_data[j].company_address);
			fhtml = fhtml.replace('total_amount',print_data[j].total_amount);
			fhtml = fhtml.replace('zongjia',print_data[j].zongjia);
			fhtml = fhtml.replace('coupon_price',print_data[j].coupon_price);
			fhtml = fhtml.replace('store_name',print_data[j].store_name);
			fhtml = fhtml.replace('store_phone',print_data[j].store_phone);
			fhtml = fhtml.replace('user_note',user_note[j]);
			fhtml = fhtml.replace('siji',print_data[j].siji);
			fhtml = fhtml.replace('tuihuo_time',print_data[j].tuihuo_time);
			fhtml = fhtml.replace('g_list',goods);

    LODOP.ADD_PRINT_TABLE(0, 0,'100%','100%', fhtml);
	LODOP.NewPageA();
	}
    LODOP.PREVIEW();
	});
	
	$(document).on("click","*[ectype='btnPrint']",function(){ //打印
		$("#printContent .print_textarea").each(function(){
			var beizhu=$(this).val();var order_id=$(this).attr('rel');
			user_note.push(beizhu);
		}); 
		var printer = '{$print_t}';
		var width = '210mm';
		var height ='140mm';
		var print_data={$print_data};
		if (printer == '' || printer == null) {
			alert('没设置好打印机。');
			return false;
		}
		$.post("/index.php/admin/Order/tuihuo_list2",
		  {
			action:"dayin",
		    ids:"{:I('ids')}"
		  },
		  function(data,status){
				var html = $("#printContent_mod").html();
				var title = jl_buy_list;
				//var strStyle = "<link rel='stylesheet' type='text/css' href='https://yc.zczmer.com/Public/js/pages_print.css?v=13y3345'>";+strStyle
				$("#content").html(html);
    LODOP = getLodop();
    LODOP.PRINT_INIT(title); // 初始化
    if(printer)
    {
        // 指定打印机
        LODOP.SET_PRINTER_INDEX(printer); 
    }

    LODOP.SET_PRINT_PAGESIZE(1,width,height,'CreateCustomPage');
		
	for(j=0;j<print_data.length;j++){
		var goods=huodong='';
		var g_list=print_data[j].g_list;console.log(g_list);

		for (i=0;i<g_list.length;i++){
			goods+='<tr><td>'+(i+1)+'</td><td class="p-name">'+g_list[i].goods_name+' </td><td>'+g_list[i].spec_key_name+'</td><td>'+g_list[i].goods_num+'</td><td>'+g_list[i].member_goods_price+'</td><td>'+g_list[i].yuanjia+'</td><td>'+g_list[i].coupon_price+'</td><td>￥'+g_list[i].xiaoji+'</td></tr>';
		}
			
		var fhtml = html.replace(/（）/g,"("+1+")");
			fhtml = fhtml.replace('biaoshi_xian',print_data[j].biaoshi_xian);
			fhtml = fhtml.replace('ID',print_data[j].id);
			fhtml = fhtml.replace('biaoshi',print_data[j].biaoshi);
			fhtml = fhtml.replace('tuihuo_qr',print_data[j].tuihuo_qr);
			fhtml = fhtml.replace('order_sn',print_data[j].order_sn);
			fhtml = fhtml.replace('company',print_data[j].company);
			fhtml = fhtml.replace('mobile',print_data[j].mobile);
			fhtml = fhtml.replace('fast_text',print_data[j].fast_text);
			fhtml = fhtml.replace('company_address',print_data[j].company_address);
			fhtml = fhtml.replace('total_amount',print_data[j].total_amount);
			fhtml = fhtml.replace('coupon_price',print_data[j].coupon_price);
			fhtml = fhtml.replace('zongjia',print_data[j].zongjia);
			fhtml = fhtml.replace('store_name',print_data[j].store_name);
			fhtml = fhtml.replace('store_phone',print_data[j].store_phone);
			fhtml = fhtml.replace('user_note',user_note[j]);
			fhtml = fhtml.replace('siji',print_data[j].siji);
			fhtml = fhtml.replace('tuihuo_time',print_data[j].tuihuo_time);
			fhtml = fhtml.replace('g_list',goods);
    LODOP.ADD_PRINT_TABLE(0, 0,'100%','100%', fhtml);
	LODOP.NewPageA();
	}
    LODOP.PRINT();
			  
			  });
		  
	});
	
	
	</script>
</body>
</html>